Dynomotion

Group: DynoMotion Message: 9509 From: Colin Fera Date: 5/21/2014
Subject: pass variable to windows program
Hi Tom,

I would like to pass a variable to a windows program when calling it from kmotion CNC

Would it be difficult for me to edit kmotion cnc to be able to do this?

I am using a command line app called modpoll to start and stop the spindle via Modbus over rs232 from the PC running kmotion CNC and would like to be able to send it the speed from the S### in the gcode file.  I know that this won't be real time but I am not doing any rigid tapping.

As an aside It would be really cool if kmotion CNC had some Modbus capabilities.

Even for rigid taping you could use Modbus from the PC to set the speed and use kflop to start and stop the spindle.

Also most of the VFD's Ive seen can phase current available via Modbus. which could be used to add a spindle load display to kmotion which would be pretty cool.

-Colin





Group: DynoMotion Message: 9510 From: Tom Kerekes Date: 5/21/2014
Subject: Re: pass variable to windows program
Hi Colin,

KMotionCNC can already send the speed to a Windows program.  Several users have already done what you describe.

Search the Group Conversations for modpoll or see:
https://groups.yahoo.com/neo/groups/DynoMotion/conversations/topics/7941

This post has a little C++ program that you might find useful to scale and format the speed for the modbus call.
https://groups.yahoo.com/neo/groups/DynoMotion/conversations/messages/9124
KFLOP also has a UART/RS232 port that can do real-time Modbus.   See the \C Programs\RS232\ModBus examples.  But you would need to modify KMotionCNC to add a "Phase Current" display.

HTH
Regards
K


Group: DynoMotion Message: 9511 From: Colin Fera Date: 5/21/2014
Subject: Re: pass variable to windows program
Hi Tom,

Just to clarify when I call an external program for spindle on the rpm will be passed as a decimal number on the end of the command?

I'm using Kmotion 4.32, do I need to include a variable in the program call?

Will kmotion proceed before it receives a return 0 from the program?

Thanks as always for being so responsive.

Colin

On May 21, 2014, at 11:49 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

Hi Colin,

KMotionCNC can already send the speed to a Windows program.  Several users have already done what you describe.

Search the Group Conversations for modpoll or see:

This post has a little C++ program that you might find useful to scale and format the speed for the modbus call.
KFLOP also has a UART/RS232 port that can do real-time Modbus.   See the \C Programs\RS232\ModBus examples.  But you would need to modify KMotionCNC to add a "Phase Current" display.

HTH
Regards
K


Group: DynoMotion Message: 9512 From: Tom Kerekes Date: 5/21/2014
Subject: Re: pass variable to windows program
Hi Colin,

Not for Spindle on but (M3) rather for Spindle Speed (Sxxxx).  The S value multiplied by the SSO will be passed on the end of the command.

Other M Codes will pass the P Q R words if specified.

KMotionCNC will wait until the called Windows program terminates.  If you don't wish to wait it is possible to use a batch file that returns immediately but "Starts" a new Windows Process.

Regards
TK